﻿




using System.Web;
using System.Web.Routing;

namespace Hotpot.Routing
{
    public class IsInFormCollection : IRouteConstraint
    {
        public bool Match(HttpContextBase httpContext, Route route, string parameterName, RouteValueDictionary values, RouteDirection routeDirection)
        {
            var paramValues = httpContext.Request.Form.GetValues(parameterName);
            return paramValues != null && paramValues.Length > 0;
        }
    }
}